package com.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.spring.web.plugins.SpringIntegrationPluginNotPresentInClassPathCondition;

@Api(tags = "说明")
@RestController
@RequestMapping
public class myController {

    @GetMapping("/hello")
    public String hello(){
        System.out.println("进入hello接口");
        return "从这里获得数据";
    }

    @GetMapping("/getU")
    @ApiImplicitParams({
            @ApiImplicitParam(name="userName", value = "name", example = "admin", dataTypeClass = String.class),
            @ApiImplicitParam(name = "age", value = "年龄", example = "16", dataTypeClass = Integer.class)
    })
    public String GetUser(String userName, Integer age){
        System.out.println("用户姓名"+userName);
        System.out.println("年龄"+age);
        return "获取前端数据并返回后端数据";
    }
}
